var t = getApp(),
b=t.requirejs("api/kjb"),
  e = t.requirejs("core");
Page({
  data: {
    code: false,
    consume: false,
    store: false,
    cancelindex: 0,
    diyshow: {},
    list:[]

  },
  onLoad: function (t) {
    e.setting();
    this.setData({
      options: t,
      config: getApp().config
    })
    this.get_list()
  },
  onShow: function () {
    
   // this.goods_like()
  },
  /**
* 下拉刷新
*/
  onPullDownRefresh: function () {
    this.get_list()
    wx.stopPullDownRefresh();
  },
  /**
   *获取订单信息
   * @param order_id 订单id
   * @param buyer_id 用户id
   * @return array
   */
  get_list: function () {
    var t = this;
    e.get("Miaosha/GetOrder", {
      buyer_id: getApp().getCache("userinfo").uid,
      order_id:t.data.options.order_id}, function (i) {
        console.log(i)
      0 == i.code ? (i.show = true, 
      t.setData(i)) : (e.alert(i.msg), wx.redirectTo({
          url: "/yb_mingpian/pages/miaosha/order/index"
      }))
    })
  },
  /**
   *推荐商品
   * @return array
   */
  goods_like: function () {
    var that = this;
    b.kj_list('', 1, 1, that, function (t) {
      that.setData(t)
    })
  },
 /**
* 打电话
*/
  phone: function (t) {
    e.phone(t)
  },
  
  /**
 * 跳转至详情
 */
  url: function (t) {
    var data = e.pdata(t);
      wx.navigateTo({
        url: '/yb_mingpian/pages/miaosha/goods_info/index?id=' + data.id
      })
  }

})